package com.cqc.paoclient.base;

import io.reactivex.disposables.CompositeDisposable;

/**
 * Created by cui on 2017/11/21.
 */

public class BaseRxPresenter<V extends BaseView> implements BasePresenter<V> {

    protected CompositeDisposable disposable;
    protected V mView;

    @Override
    public void setView(V mView) {
        this.mView = mView;
        disposable = new CompositeDisposable();
    }

    @Override
    public void removeView() {
        mView = null;
        if (disposable != null && !disposable.isDisposed()) {
            disposable.dispose();
        }
    }
}
